package com.mangguo.tingjian.content.mapper;

import com.mangguo.tingjian.content.dto.SearchWordResult;
import com.mangguo.tingjian.content.entity.DwSearchWord;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 热词搜索表 Mapper 接口
 * </p>
 *
 * @author auto
 * @since 2019-11-24
 */
@Mapper
public interface DwSearchWordMapper extends BaseMapper<DwSearchWord> {
    @Select("select count(1) as count,searchWords from dw_search_word where mdate >= #{start} and mdate <= #{end} group by searchWords order by count desc limit 10")
    List<SearchWordResult> countTopSearchWordsBetweenDate(@Param("start")Integer start,
                                                          @Param("end") Integer end);
}
